home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2005 October / Gamestar_77_2005-10_dvd.iso / Dema / betonsoldier_spdemo.exe / {app} / Shaders / KT_movie_player.fx < prev    next >
Encoding:
Text File  |  2005-05-05  |  3.4 KB  |  103 lines

  1. //------------------------------------------------------------------------------------------------------
  2. //------------------------------------------------------------------------------------------------------
  3. //------------------------------------------------------------------------------------------------------
  4.  
  5. #include "shared.fx"
  6.  
  7. //------------------------------------------------------------------------------------------------------
  8. //- Static parameters
  9. //------------------------------------------------------------------------------------------------------
  10.  
  11. //common things
  12. texture SourceTexture1;
  13.  
  14. //------------------------------------------------------------------------------------------------------
  15. //------------------------------------------------------------------------------------------------------
  16. //------------------------------------------------------------------------------------------------------
  17.  
  18. struct VS_PostProcess_Input
  19. {
  20.     float4    Position    :    POSITION;
  21.     float2    DiffuseUv    :    TEXCOORD0;    
  22. };
  23.  
  24. //------------------------------------------------------------------------------------------------------
  25.  
  26. struct VS_PostProcess_Output
  27. {
  28.     float4    Position    :    POSITION;
  29.     float2    DiffuseUv    :    TEXCOORD0;    
  30. };
  31.  
  32.  
  33. //------------------------------------------------------------------------------------------------------
  34. //                                        VERTEX SHADERS DECLARATIONS
  35. //------------------------------------------------------------------------------------------------------
  36. VS_PostProcess_Output                    VSBase(const VS_PostProcess_Input input);
  37.  
  38. //------------------------------------------------------------------------------------------------------
  39. //                                        VERTEX SHADERS IMPLEMENTATIONS
  40. //------------------------------------------------------------------------------------------------------
  41.  
  42. //------------------------------------------------------------------------------------------------------
  43. // VS_PostProcess_Output VSBase(const VS_PostProcess_Input input);
  44. //
  45. // simple position + uv transfer (UV correction is applied though)
  46. //------------------------------------------------------------------------------------------------------
  47. VS_PostProcess_Output VSBase(const VS_PostProcess_Input input)
  48. {
  49.     VS_PostProcess_Output output;
  50.     
  51.     // output position into world+view+projection space
  52.     output.Position = input.Position;
  53.         
  54.     // Diffuse Uv output
  55.     output.DiffuseUv = input.DiffuseUv;
  56.         
  57.     return output;
  58. }
  59.  
  60.  
  61. //------------------------------------------------------------------------------------------------------
  62. //                                            TECHNIQUES DEFINITIONS
  63. //------------------------------------------------------------------------------------------------------
  64. technique BaseRender
  65. <
  66.     int Priority = 1;
  67.     int TechniqueIndex = 0;
  68.     int DeviceType = HWSHADER_ONLY;
  69.     int LightingType = INTEGRATED_LIGHTING;
  70.     string RenderingType = "Standard";
  71. >
  72. {
  73.     pass pass1
  74.     {
  75.         Texture[0]            = <SourceTexture1>;
  76.         MinFilter[0]        = LINEAR;
  77.         MagFilter[0]        = LINEAR;
  78.         MipFilter[0]        = NONE; //no mipmaps.
  79.         AddressU[0]            = CLAMP;
  80.         AddressV[0]            = CLAMP;
  81.         AlphaBlendEnable    = false;
  82.         AlphaTestEnable        = false;
  83.         FogEnable            = false;
  84.         
  85.         CullMode            = NONE;
  86.         ZEnable                = false;
  87.         ZWriteEnable        = false;
  88.         
  89.         VertexShader = compile vs_1_1 VSBase();
  90.         
  91.         PixelShader = 
  92.         asm
  93.         {
  94.             ps_1_1    
  95.                             
  96.             tex        t0    // source texture
  97.                         
  98.             mov r0, t0    // simple output
  99.         };
  100.     }
  101. }
  102.  
  103.